<?php

namespace app\http\middleware;
use app\common\exception\BaseException;

class User
{
    public function handle($request, \Closure $next)
    {
        if($request->username && $request->password) {
            $request->password = md5(md5($request->password).'ye');
            return $next($request);
        }else {
            throw new BaseException('用户名密码不能为空，请重新输入');
        }
    }
}